package com.qf.pojo;

import java.util.List;

public class PageBean {

    //当前页码--应该从前端获取
    private int pageNum;
    //每页条数--应该从前端获取
    private int pageSize;
    //总条数--数据库查询
    private long totalCount;
    //总页数---算
    private int totalPage;
    //要展示的数据--查
    private List data;
    //起始页
    private int startPage = 1;
    //最后一页 的页码--总页数
    private int endPage;

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        //总页数
        //小数点后面有数比零大 进一
        this.totalPage=(int) Math.ceil(totalCount *1.0/pageSize) ;
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    public int getStartPage() {
        return startPage;
    }

    public void setStartPage(int startPage) {
        this.startPage = startPage;
    }

    public int getEndPage() {
        this.endPage=(int) Math.ceil(totalCount *1.0/pageSize) ;

        return endPage;
    }

    public void setEndPage(int endPage) {
        this.endPage = endPage;
    }
}
